package pl.szpadel.android.gadu.packets;

import java.io.IOException;
import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.channels.ReadableByteChannel;

/// Used for unknown packets. Simply ignores content
public class UnknownReceivedPacket extends ReceivedPacket {

	public UnknownReceivedPacket(Header hdr, InputStream stream)
			throws IOException {
		super(hdr, stream);
	}

	protected UnknownReceivedPacket(Header hdr, ReadableByteChannel channel) throws IOException {
		super(hdr, channel);
	}

	@Override
	protected void readFromBuffer(ByteBuffer buffer) {
		// do nothing
	}
	
	@Override
	public String toString() {
		return "Unknown packet [ type=0x" + Integer.toHexString(getType()) + " ]";
	}

}
